home *** CD-ROM | disk | FTP | other *** search
/ Technotools / Technotools (Chestnut CD-ROM)(1993).ISO / lang_asm / ma22#1 / example1.z80 < prev    next >
Encoding:
Text File  |  1991-07-16  |  810 b   |  50 lines

  1. ;
  2. ; Sample source file for the Zilog Z80
  3. ;
  4. ; (this program does not do anything, it is only an example)
  5. ;
  6.     title    Sample source file
  7. ;
  8. ; Definitions
  9. ;
  10. cr    equ    0dh    ;carriage return
  11. lf    equ    10    ;line feed
  12. RAM:    equ    2000h    ;memory start
  13. ppi0    equ    8000h    ;ppi 0
  14. crppi0    equ    ppi0+1    ;control register
  15. srppi0    equ    ppi0+2    ;status register
  16. flag    equ    123     ;flag bit
  17. offset    defl    0
  18. ;
  19. ; Variables
  20. ;
  21.     org    RAM    ;variables
  22. key    defs    16    ;key buffer
  23. loop1:
  24. offset    defl    9
  25. ;
  26. ; Program
  27. ;
  28.     ld    a,'*'
  29.     ld    h,a
  30.     daa
  31.     push    ix
  32.     ld    bc,messg1+offset
  33.     jp    c,loop1
  34.     out    (c),a
  35.     ld    a,(ix+3)
  36.     call    delay
  37.     jp    loop1
  38. ;
  39. ; Delay routine
  40. ;
  41. delay:    dec    h
  42.     jp    nz,delay
  43.     ret
  44. ;
  45. ; Dummy data
  46. ;
  47. routines defw    1234h,0f800h,0 ;routine addresses
  48. messg1    defb    cr,lf,'String no 1.',0
  49. messg2    defb    cr,lf,lf,'Press a key.',0
  50.     end